Class PBMAC1Params

java.lang.Object
org.mozilla.jss.pkix.primitive.PBMAC1Params
All Implemented Interfaces:
ASN1Value

public class PBMAC1Params extends Object implements ASN1Value
PKCS #5 PBMAC1-params from RFC 9879.
 PBMAC1-params ::= SEQUENCE {
   keyDerivationFunc AlgorithmIdentifier {{PBMAC1-KDFs}},
   messageAuthScheme AlgorithmIdentifier {{PBMAC1-MACs}}
 }
 
  • Field Details

  • Constructor Details

    • PBMAC1Params

      public PBMAC1Params(AlgorithmIdentifier keyDerivationFunc, AlgorithmIdentifier messageAuthScheme)
      Creates PBMAC1 parameters.
      Parameters:
      keyDerivationFunc - The key derivation function AlgorithmIdentifier (typically PBKDF2 with salt, iterations, and PRF)
      messageAuthScheme - The MAC algorithm AlgorithmIdentifier (typically HMAC-SHA256, HMAC-SHA384, or HMAC-SHA512)
  • Method Details

    • getKeyDerivationFunc

      public AlgorithmIdentifier getKeyDerivationFunc()
      Returns the key derivation function (typically PBKDF2).
    • getMessageAuthScheme

      public AlgorithmIdentifier getMessageAuthScheme()
      Returns the message authentication scheme (typically HMAC-SHA256/384/512).
    • getTag

      public Tag getTag()
      Returns the ASN.1 tag for this structure.
      Specified by:
      getTag in interface ASN1Value
      Returns:
      The SEQUENCE tag
    • encode

      public void encode(OutputStream ostream) throws IOException
      Encodes this PBMAC1Params to the output stream.
      Specified by:
      encode in interface ASN1Value
      Parameters:
      ostream - The output stream
      Throws:
      IOException - if encoding fails
    • encode

      public void encode(Tag implicitTag, OutputStream ostream) throws IOException
      Encodes this PBMAC1Params with an implicit tag.
      Specified by:
      encode in interface ASN1Value
      Parameters:
      implicitTag - The implicit tag to use
      ostream - The output stream
      Throws:
      IOException - if encoding fails
    • getTemplate

      public static PBMAC1Params.Template getTemplate()
      Returns the template for decoding PBMAC1Params.
      Returns:
      The PBMAC1Params template